<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8" />
		<title>会员列表-WeAdmin Frame型后台管理系统-WeAdmin 1.0</title>
		<meta name="renderer" content="webkit" />
		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0" />
		<link rel="stylesheet" href="../../static/css/font.css" />
		<link rel="stylesheet" href="../../static/css/weadmin.css" />
		<!-- 让IE8/9支持媒体查询，从而兼容栅格 -->
		<!--[if lt IE 9]>
		  <script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
		  <script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
		<![endif]-->
	</head>

	<body>
		<div class="weadmin-nav">
			<span class="layui-breadcrumb">
				<a href="javascript:;">首页</a> <a href="javascript:;">会员管理</a>
				<a href="javascript:;"> <cite>会员列表</cite></a>
			</span>
			<a class="layui-btn layui-btn-sm" style="margin-top:3px;float:right" href="javascript:location.replace(location.href);"
			 title="刷新">
				<i class="layui-icon layui-icon-refresh"></i>
				<!-- <i class="layui-icon" style="line-height:30px">&#x1002;</i> -->
			</a>
		</div>

		<div class="weadmin-body">
			<div class="layui-row">
				<form class="layui-form layui-col-md12 we-search">
					会员搜索：
					<div class="layui-inline">
						<input class="layui-input" placeholder="开始日" name="start" id="start" />
					</div>
					<div class="layui-inline">
						<input class="layui-input" placeholder="截止日" name="end" id="end" />
					</div>
					<div class="layui-inline">
						<input type="text" name="username" placeholder="请输入用户名" autocomplete="off" class="layui-input" />
					</div>
					<button class="layui-btn" lay-submit="" lay-filter="sreach">
						<i class="layui-icon layui-icon-search"></i>
					</button>
				</form>
			</div>
			<div class="weadmin-block">
				<button class="layui-btn layui-btn-danger" onclick="delAll()">
					<i class="layui-icon layui-icon-delete"></i>批量删除
				</button>
				<button class="layui-btn" onclick="WeAdminShow('添加用户','./add2.html',600,400)">
					<i class="layui-icon layui-icon-add-circle-fine"></i>添加
				</button>
				<span class="fr" style="line-height:40px">共有数据：88 条</span>
			</div>
			<!--<table class="layui-table" id="memberList">
				<thead>
					<tr>
						<th>
							<div class="layui-unselect header layui-form-checkbox" lay-skin="primary">
								<i class="layui-icon">&#xe605;</i>
							</div>
						</th>
						<th>ID</th>
						<th>用户名</th>
						<th>性别</th>
						<th>手机</th>
						<th>邮箱</th>
						<th>地址</th>
						<th>加入时间</th>
						<th>状态</th>
						<th>操作</th>
					</tr>
				</thead>
				<tbody>
					<tr data-id="1">
						<td>
							<div class="layui-unselect layui-form-checkbox" lay-skin="primary" data-id="1">
								<i class="layui-icon">&#xe605;</i>
							</div>
						</td>
						<td>1</td>
						<td>小张</td>
						<td>男</td>
						<td>17600000000</td>
						<td>admin@mail.com</td>
						<td>北京市 海淀区</td>
						<td>2017-01-01 11:11:42</td>
						<td class="td-status">
							<span class="layui-btn layui-btn-normal layui-btn-xs">已启用</span>
						</td>
						<td class="td-manage">
							&lt;!&ndash;<a onclick="member_stop(this,'10001')" href="javascript:;" title="启用">
								<i class="layui-icon layui-icon-download-circle"></i>
							</a>&ndash;&gt;
							<button title="编辑" onclick="WeAdminEdit('编辑','./edit.html', 1, 600, 400)" href="javascript:;">
								<i class="layui-icon layui-icon-edit"></i>
							</button>
							&lt;!&ndash;<a onclick="WeAdminShow('修改密码','./password.html',600,400)" title="修改密码" href="javascript:;">
								<i class="layui-icon layui-icon-util"></i>
							</a>&ndash;&gt;
							<button title="删除" onclick="member_del(this,'要删除的id')" href="javascript:;">
								<i class="layui-icon layui-icon-delete"></i>
							</button>
						</td>
					</tr>
				</tbody>
			</table>-->

			<table class="layui-table" id="memberList" lay-data="{width: 1322, height:400, url:'/user/selectAll', page:true, id:'idTest'}" lay-filter="demo">
				<thead>
				<tr>
					<th lay-data="{type:'checkbox', fixed: 'left'}"></th>
					<th lay-data="{field:'uuid', width:80,fixed: true, align:'center'}">ID</th>
					<th lay-data="{field:'username', width:100, align:'center'}">用户名</th>
					<th lay-data="{field:'sex', width:100, align:'center'}">性别</th>
					<th lay-data="{field:'age', width:100, align:'center'}">年龄</th>
					<th lay-data="{field:'telephone', width:200, align:'center'}">手机</th>
					<th lay-data="{field:'email', width:200, align:'center'}">邮箱</th>
					<th lay-data="{field:'address', width:210, align:'center'}">地址</th>
					<th lay-data="{field:'status', width:100, align:'center'}">状态</th>
					<th lay-data="{fixed: 'right', width:170, align:'center', toolbar: '#barDemo'}"></th>
				</tr>
				</thead>
			</table>
			<script type="text/html" id="barDemo">
				<a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="detail">查看</a>
				<a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a>
				<a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a>
			</script>
			<!--<div class="page">
				<div>
					<a class="prev" href="">&lt;&lt;</a> <a class="num" href="">1</a>
					<span class="current">2</span> <a class="num" href="">3</a>
					<a class="num" href="">489</a> <a class="next" href="">&gt;&gt;</a>
				</div>
			</div>-->
		</div>
		<!--<script type="text/javascript" src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>-->
		<script src="../../lib/layui/layui.js" charset="utf-8"></script>
		<script src="../../static/js/eleDel.js" type="text/javascript" charset="utf-8"></script>
	</body>


	<script>
        layui.use('table', function(){
            var table = layui.table;
            //监听表格复选框选择
            table.on('checkbox(demo)', function(obj){
                console.log(obj)
            });
            //监听工具条
            table.on('tool(demo)', function(obj){
                var data = obj.data;
                //console.log(data.uuid);
                if(obj.event === 'detail'){
                    WeAdminEdit('编辑','./edit.html', 1, 600, 400);
                } else if(obj.event === 'del'){
                    layer.confirm('真的删除行么', function(index){
                        obj.del();
                        layer.close(index);
                    });
                } else if(obj.event === 'edit'){
                    WeAdminEdit('编辑','./edit.html', data.uuid,500, 500);
                }
            });

            var $ = layui.$, active = {
                getCheckData: function(){ //获取选中数据
                    var checkStatus = table.checkStatus('idTest')
                        ,data = checkStatus.data;
                    layer.alert(JSON.stringify(data));
                }
                ,getCheckLength: function(){ //获取选中数目
                    var checkStatus = table.checkStatus('idTest')
                        ,data = checkStatus.data;
                    layer.msg('选中了：'+ data.length + ' 个');
                }
                ,isAll: function(){ //验证是否全选
                    var checkStatus = table.checkStatus('idTest');
                    layer.msg(checkStatus.isAll ? '全选': '未全选')
                }
            };

            $('.demoTable .layui-btn').on('click', function(){
                var type = $(this).data('type');
                active[type] ? active[type].call(this) : '';
            });
        });
	</script>

</html>
